import service from "../../utils/request.ts";

/**
 * 获取用户列表
 */
export const getUserList= (data)=> {
    return service({
        url: "/user/page",
        method: "post",
        data:data
    })
}

/**
 * 获取用户列表
 */
export const resetPassword= (data)=> {
    return service({
        url: "/user/resetPassword",
        method: "post",
        data:data
    })
}


export const addOrUpdateUser= (data,type)=> {
    return service({
        url: `/user/addOrUpdate/${type}`,
        method: "post",
        data:data
    })
}

export const getUserInfoById= (id)=> {
    return service({
        url: `/user/${id}`,
        method: "get",
        data:null
    })
}

export const deleteUserById= (id)=> {
    return service({
        url: `/user/${id}`,
        method: "delete",
        data:null
    })
}


export const deleteUserByIdBatch= (ids)=> {
    return service({
        url: `/user/deleteBatch`,
        method: "delete",
        data:ids
    })
}

export const importUser = (file)=> {
    return service({
        url: `/user/import`,
        method: 'Post',
        data: file
    })
}

export const getTeachers = ()=> {
    return service({
        url: `/user/teacherList`,
        method: 'get',
        data: null
    })
}
